let count = 10; //每一页的条数
let page = 1; //当前页
let pageArr = [10, 12, 15, 20];
let maxpage
//渲染页面
showData()
function showData() {
  $.ajax({
    url: '/gonggao/query',
    data: {
      count: count,
      page: page
    },
    success: (res) => {
      if (res.error) {
        console.log(res.erro);
      } else {
        // 渲染表格
        $('.mtbody').html('')
        $(res.data).each((index, item) => {
          $('.mtbody').append(`
                    <tr data-id="${item.g_id}">
                    <td>${item.g_biaoti}</td>
                    <td>${item.g_name}</td>
                        <td>${item.g_date.slice(0, 10)}</td>
                        <td>${item.g_lanmu}</td>
                        <td>${item.g_tixing}</td>
                        <td>${item.g_jieshou}</td>
                        <td><button class='del'>删除</button></td>
                    </tr>
                    `);
        });
        $('#myli').html('')
        maxpage = Math.ceil((res.total / count))
        for (let i = 1; i <= Math.ceil((res.total / count)); i++) {
          if (page == i) {
            $('#myli').append(`
                                <a id="a" class="active new_page" href="javascript:;">${i}</a>
                                        `)
          } else {
            $('#myli').append(`
                        <a href="javascript:;" id="a">${i}</a>
                       `)
          }
        }
      }
    }
  });
};


//删除


//点击页码

